package org.Szf.winter;

import org.Szf.config.AppConfig;

import java.lang.reflect.InvocationTargetException;

/**
 * @author shen zhefan
 * @date 2024-12-11 11:40
 */
public class WinterApplicationContext {

    private AppConfig appConfig;

    public WinterApplicationContext(Class<AppConfig> appConfigClass) {
        try {
            this.appConfig = appConfigClass.getDeclaredConstructor().newInstance();
        } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
            throw new RuntimeException("Failed to instantiate AppConfig", e);
        }
    }
}